home *** CD-ROM | disk | FTP | other *** search
/ Danny Amor's Online Library / Danny Amor's Online Library - Volume 1.iso / html / faqs / faq / aix-faq / part1 next >
Encoding:
Text File  |  1995-07-25  |  67.8 KB  |  2,035 lines

  1. Subject: AIX Frequently Asked Questions (Part 1 of 3)
  2. Newsgroups: comp.unix.aix,comp.answers,news.answers
  3. From: jwarring@amsinc.com (Jeff Warrington)
  4. Date: 14 Nov 1994 05:14:54 GMT
  5.  
  6. Archive-name: aix-faq/part1
  7. Last-modified: Nov 13, 1994
  8. Version: 3.70
  9.  
  10.  
  11. I want to thank everyone for their contributions again this month, if
  12. I have missed one please remind me...
  13.  
  14. Frequently Asked Questions to AIX 3.x and IBM RS/6000
  15. _____________________________________________________
  16.  
  17. This posting contains frequently asked questions and answers about the
  18. IBM RS/6000 series workstations and AIX version 3. All input is very
  19. welcome, I can be reached at jwarring@flAIXy.fd.amsinc.com
  20.  
  21. The list is split into three articles to pass thru most mailers. I'll
  22. usually try to post them once a month to comp.unix.aix, news.answers,
  23. and comp.answers. Please let your input continue as I am most thankful
  24. for all of it.
  25.  
  26. This FAQ is availible from:
  27. <ftp://rtfm.mit.edu:/pub/usenet/news.answers/aix-faq/part[123]>
  28. <http://www.cis.ohio-state.edu/hypertext/faq/usenet/aix-faq/top.html>
  29.  
  30. If you see a From: line it means that whatever follows is either an
  31. unabridged or slightly edited version of the input I have received, and
  32. that I may not have verified its contents. If there is no From: line, I
  33. probably know what I am talking about, and the entry is edited from
  34. various sources.
  35.  
  36. All entries are numbered with major and minor subject number, e.g. 
  37. 2.11. If the subject is preceded by an asterisk, that entry has been
  38. changed or added since the last posting.
  39.  
  40. The comp.unix.aix group is for AIX on all IBM platforms -- RT, PS/2,
  41. 370, RS/6000 and mainframes (ESA based on OSF/1), but the traffic has
  42. evolved to discuss predominantly AIX 3.x and the RS/6000. The
  43. newsgroups comp.sys.ibm.pc.rt and comp.sys.ibm.ps2.hardware cover the
  44. RT, mostly hardware and AOS 4.3, and on PS/2 hardware respectively. 
  45. Mark Whetzel posts FAQ lists about RTs in the rt and *.answers groups.
  46. There are few to non-existent discussions on AIX/370 and AIX/ESA.
  47.  
  48. This article covers only AIX 3.x and the RS/6000, except when noted.
  49.  
  50. If you post questions to comp.unix.aix, please be sure to indicate:
  51.  
  52. - the machine type and brief configuration, e.g. Model 540, 64 MB RAM,
  53.   48 MB swap space (this is actually bad), 1.2 GB XYZ hard drive, etc.
  54.   Note: There are now three classes of RS/6000s - the original, RS or
  55.   POWER, RS/2 or POWER2, and PowerPC.
  56.  
  57. - the exact AIX version number, i.e. AIX 3.1 is NOT sufficient, whereas
  58.   AIX 3.1.5 or AIX 3.1 with the 3005 update is. With 3.2 you should
  59.   mention any significant ptfs using the U4xxxxx numbers.
  60.  
  61. I am doing this on my own time. Please do not ask me questions that
  62. should be asked to IBM. If you suspect you have software defect problems
  63. call (800) 237-5511. If you have hardware problems call (800) IBM-SERV.
  64. ______________________________________________________________________________
  65.  
  66. Table of contents:
  67.  
  68. 1.0    General concepts
  69. 1.000  The AIX operating system - what is it?
  70. 1.001  I know neither Unix nor AIX - where do I find more information?
  71. 1.002  What is the Object Database?
  72. 1.003  How do I get rid of the verbose error messages?
  73. 1.004  Which release of AIX do I have?
  74.  
  75. 1.1    SMIT, system administration, file systems
  76. 1.100  I am used to Unix systems programming, why should I learn SMIT?
  77. 1.101  How do I turn off the "running man" in smit?
  78. 1.102  How do I import an /etc/passwd or /etc/group file from another box?
  79. 1.103  Cleaning up utmp, who, and accounting problems
  80. 1.104  How to fsck the root filesystem
  81. 1.105  How can I unmount /usr to run fsck on it?
  82. 1.106  How do I shrink /usr?
  83. 1.107  How do I make a filesystem larger than 2Gb?
  84. 1.108  How do I see/change parameters like number of processes per user?
  85. 1.109  How do I shrink the default paging space on hd6?
  86. 1.110  The swapper seems to use enormous amounts of paging space, why?
  87. 1.111  How much paging space do I need?
  88. 1.112  How do I mount a floppy disk as a filesystem?
  89. 1.113* How do I remove a committed lpp?
  90. 1.114  How can I recover space after installing updates?
  91. 1.115  Where are the AIX log files kept?
  92. 1.116  How can I log information about ftp accesses to a file?
  93. 1.117  How do I find a file name from the inode number?
  94. 1.118  How do I set up postscript accounting?
  95. 1.119  How do I create boot diskettes for 3.2?
  96. 1.120  Where can I find tools for performance monitoring?
  97. 1.121  How can I tell what virtual printer a print queue is using?
  98. 1.122  Two srcmstr's are less useful than one?
  99. 1.123  How do I set the tty name associated with a physical port?
  100. 1.124  How do I use mksysb to clone a system?
  101. 1.125  How do I retain timestamps with mksysb?
  102. 1.126  How can I find out the machine type?
  103. 1.127  Updating to 3.2.5
  104. 1.128  AIX fix strategy
  105. 1.129  Are passwords limited to 8 char?
  106. 1.130  How do I increase the number of ptys > 64?
  107. 1.131  CERT advisories on sendmail and xterm
  108. 1.132  How do I remove a non-existant physical volume?
  109. 1.133  How do I kill a process that ignores kill -QUIT -KILL -STOP?
  110. 1.134  How can I see "console" messages?
  111. 1.135+ Where can I find TOP for AIX?
  112. 1.136+ How can I restrict root logins to specific terminals?
  113.  
  114. 1.2    Backups, tape
  115. 1.200  Some info about tape backups
  116. 1.201  How do I do remote backup?
  117. 1.202  How do I backup a multi-disk volume group?
  118. 1.203  How do I put multiple backups on a single 8mm tape?
  119. 1.204  How can I make an exact duplicate of a tape over the network?
  120. 1.205  What is tape block size of 0?
  121. 1.206  Resetting a hung tape drive...
  122. 1.207  How do I read a mksysb tape with tar?
  123. 1.208  How do I read a 5Gbyte tape on a 2Gbyte drive?
  124.  
  125. 1.3    Memory and process management
  126. 1.300  Some info about the memory management system
  127. 1.301  How much should I trust the ps memory reports?
  128. 1.302  Which simms do RS6000's use?
  129.  
  130. 1.4    Shells, commands, man pages, InfoExplorer
  131. 1.400  How do I make an informative prompt in the shell?
  132. 1.401  How do I set up ksh for emacs mode command line editing?
  133. 1.402  Listing files with ls causes a core dump
  134. 1.403  How do I put my own text into InfoExplorer?
  135. 1.404  InfoExplorer ASCII key bindings 
  136. 1.405  How can I add new man pages to the system?
  137. 1.406  Why can't I read man pages?  Where is nroff?
  138.  
  139. 1.5    Video, Graphics, X11
  140. 1.500  Which release of X11 do I have?
  141. 1.501  How to prevent ctrl-alt-backspace from killing the X session
  142. 1.502  Who has a termcap/terminfo source for aixterm or the HFT console?
  143. 1.503  How can I look at PostScript files?  Why is "dpsexec" so lousy?
  144. 1.504  unix:0 vs `hostname`:0
  145. 1.505  VT100 key bindings for aixterm
  146. 1.506  Is there a screen saver that does not use excessive CPU?
  147. 1.507  Where are the colors, availible for an X session, listed.
  148. 1.508  Why does my app hang the X server but not an X station?
  149. 1.509  How do I switch the control and caps lock key bindings?
  150. 1.510  Missing fonts?
  151. 1.511+ What's the termcap entry for an IBM 3151 look like?
  152. 1.512+ Errors starting X11 application binaries from aixpdslibs.
  153.  
  154. 1.6    Networks and communications
  155. 1.600  My named dies frequently, why?
  156. 1.601  How do I trace ethernet packets on an AIX system?
  157. 1.602  What is the authorized way of starting automount at boot time?
  158. 1.603  How do I set a tty port for both dial-in and dial-out?
  159. 1.604  How to move or copy whole directory trees across a network
  160. 1.605  How can I send mail to hosts that cannot be pinged?
  161. 1.606  How to configure dialup SLIP
  162. 1.607  Where is DCE discussed?
  163. 1.608  How do I make /var/spool/mail mountable?
  164. 1.609  getty spawning too rapidly
  165. 1.610  Does AIX support Compressed SLIP (CSLIP)?
  166. 1.611  How do I setup anonymous ftp on my AIX system?
  167. 1.612+ Talk, getting notification.
  168. 1.613+ Disabling software flow control; using RTS/CTS.
  169.  
  170. 1.7
  171. 1.8
  172.  
  173. 1.9    Miscellaneous
  174. 1.900  SCSI-1 and SCSI-2 "interoperability" got you confused?
  175. 1.901  How to get your keyboard back after unplugging it from the 6000
  176. 1.902  How do I set up pcsim, the DOS emulator?
  177. 1.903  How do I transfer files between AIX and DOS disks?
  178. 1.904+ Where is the crypt program.
  179.  
  180. 2.00  C/C++
  181. 2.01  I cannot make alloca work
  182. 2.02  How do I compile my BSD programs?
  183. 2.03  Isn't the linker different from what I am used to?
  184. 2.04  How do I link my program with a non-shared /lib/libc.a?
  185. 2.05  How do I make my own shared library?
  186. 2.06  Linking my program fails with strange error, why?
  187. 2.07  What's with malloc()?
  188. 2.08  Why does xlc complain about 'extern char *strcpy()'
  189. 2.09  Why do I get 'Parameter list cannot contain fewer ....'
  190. 2.10  Why does xlc complain about '(sometype *)somepointer = something'
  191. 2.11  Some more common errors
  192. 2.12  Can the compiler generate assembler code?
  193. 2.13  Curses
  194. 2.14  How do I speed up linking?
  195. 2.15  What is deadbeef?
  196. 2.16  How do I statically link in 3.2?
  197. 2.17  How do I make an export list from a library archive?
  198. 2.18  imake, makedepend 
  199. 2.19  How can tell what shared libraries a binary is linked with?
  200.  
  201. 3.00  Fortran and other compilers
  202. 3.01  I have problems mixing Fortran and C code, why?
  203. 3.02  How do I statically bind Fortran libraries and dynamically bind
  204.       C libraries?
  205. 3.03  How do I check if a number is NaN?
  206. 3.04  Some info sources on IEEE floating point
  207.  
  208. 4.00  GNU and Public Domain software
  209. 4.01  How do I find PD software?
  210. 4.02  Are there any ftp sites?
  211. 4.03  General hints
  212. 4.04* GNU Emacs
  213. 4.05  gcc/gdb
  214. 4.06  GNU Ghostscript
  215. 4.07  TeX
  216. 4.08  Perl
  217. 4.09  X-Windows
  218. 4.10  bash
  219. 4.11  Elm
  220. 4.12  Oberon 2.2
  221. 4.13  Kermit
  222. 4.14  Gnu dbm
  223. 4.15  tcsh
  224. 4.16  Kyoto Common Lisp
  225. 4.17  Tcl/Tk
  226. 4.18  Expect
  227. 4.19  Public domain software on CD
  228. 4.20  Andrew Toolkit
  229. 4.21  sudo
  230. 4.22  Flexfax and other fax software
  231. 4.23  lsof
  232. 4.24  popper
  233. 4.26  mpeg link errors version 2.0
  234.  
  235. 5.00  Third party products
  236. 5.02  Disk/Tape/SCSI
  237. 5.03  Memory
  238. 5.04  Others
  239. 5.05  C++ compilers
  240. 5.06  Memory leak detectors
  241. 5.07  PPP
  242. 5.08  Graphics adapters.
  243. 5.09  Training Courses
  244.  
  245. 6.00  Miscellaneous other stuff
  246. 6.01  Can I get support by e-mail?
  247. 6.02  List of useful faxes
  248. 6.03  IBM's ftp, gopher and WWW presence
  249. 6.04  Some RS232 hints
  250. 6.05* What publications are available for AIX and RS/6000?
  251. 6.06  Some acronyms
  252. 6.07  How do I get this by mailserver or ftp?
  253. 6.08  Hypertext version of the FAQ
  254. 6.09  Where can I send suggestions for tools?
  255. 6.10  comp.unix.aix archive availible on the WWW
  256.  
  257. 7.00  Contributors
  258.  
  259. ______________________________________________________________________________
  260. 1.000: The AIX operating system - what is it?
  261.  
  262. This is best answered by reading the text files in /usr/lpp/bos. The
  263. README file there contains general information and the BSD files contain
  264. useful information if you know BSD and/or System V.
  265.  
  266. The last release for the RT PC is 2.2.1. The latest release for PS/2s
  267. and Intel architecture machines is AIX 1.3; for PS/2s only, 1.2.1. For
  268. the RS/6000, there are two major levels, 3.1 and 3.2, and various
  269. intermediate levels. IBM has dropped support for 3.1.
  270.  
  271.  
  272. 1.001: I know neither Unix nor AIX - where do I find more information?
  273.  
  274. If you are new to Unix, you should look at the other newsgroups in the
  275. comp.unix hierarchy, in particular comp.unix.questions (for basic
  276. questions) or comp.unix.wizards (for difficult questions). These two
  277. groups have a common FAQ posting as well.
  278.  
  279. If you need information about C programming, try comp.lang.c or
  280. comp.std.c, the latter for Standard ANSI C issues.  comp.lang.c has a
  281. FAQ posting.
  282.  
  283.  
  284. 1.002: What is the Object Database?
  285. From: Uwe Geuder <Uwe.Geuder@informatik.uni-stuttgart.de>
  286.  
  287. AIX stores most of the system management information in /etc/objrepos,
  288. /usr/lib/objrepos, and /usr/share/lib/objrepos. Files (also referred to
  289. as system object classes) in these directories are adminstered by the
  290. Object Database Manager, ODM, which is a set of library routines and
  291. programs providing basic object oriented database facilities.
  292.  
  293. Under most circumstances, only SMIT or the commands SMIT call (see
  294. 1.100) should be used to change the contents of the system object
  295. classes. A harmless way to look at the object database is to use odmget
  296. <Class> where <Class> is one of the files in /etc/objrepos.
  297.  
  298. Experienced users can use the ODM editor, odme, to navigate the database
  299. in detail. Modifying the database should only be attempted if you know
  300. exactly what you are doing.
  301.  
  302.  
  303. 1.003: How do I get rid of the verbose error messages?
  304. Corrected by Bjorn P. Brox <brox@corena.n>
  305.  
  306. Many of the messages from the Unix commands are available in different
  307. languages. This is controlled by the LANG environment variable, the
  308. default being En_US meaning English in the US. All the default messages
  309. have a message number associated with them, e.g.:
  310.  
  311. $ cat no-such-file
  312. cat: 0652-050 Cannot open no-such-file.
  313.  
  314. If you prefer the terser Unix-looking error message, set your
  315. environment variable LC_MESSAGES to C, and you will get:
  316.  
  317. $ cat no-such-file
  318. cat: Cannot open no-such-file.
  319.  
  320. By default LC_MESSAGES is the same as your environment LANG.  Setting
  321. LANG does also work, but should be avoided since it changes
  322. app-defaults lookup etc.  See locale(): LC_ALL
  323.  
  324.  
  325. 1.004: Which release of AIX or other products do I have?
  326.  
  327. New with 3.2.5: The oslevel command shows OS and component levels.
  328. Run oslevel -help to see options
  329.  
  330. The command 'lslpp -h bos.obj' will show all lines referring to the BOS, 
  331. Basic Operating System.  E.g.:
  332.  
  333. Fix Id  Release         Status    Action     Date       Time     User Name
  334. ------- --------------- --------- ---------- ---------- -------- ---------
  335. Path: /usr/lib/objrepos
  336. bos.obj
  337.         03.02.0000.0000 COMPLETE  COMMIT     12/31/69   18:00:00 root
  338. U401864 03.02.0000.0000 COMPLETE  COMMIT     11/12/92   20:09:35 root
  339. U401968 03.02.0000.0000 COMPLETE  COMMIT     11/12/92   23:18:21 root
  340. U401969 03.02.0000.0000 COMPLETE  COMMIT     11/12/92   23:18:20 root
  341.                  ..........................
  342. U418349 03.02.0000.0000 COMPLETE  COMMIT     08/28/93   15:34:13 root
  343. U419950 03.02.0000.0000 COMPLETE  COMMIT     08/28/93   15:34:11 root
  344.  
  345. For AIX 3.2, you may come across discussions on 3.2.0, 3.2.1, 3.2.2,
  346. 3.2.3 extended, 3.2.4 and 3.2.5.  There is no absolute way to tell which
  347. of these you are running since the newer releases are simply 3.2.0 with
  348. some sets of PTFs added. See above example listing. These selective
  349. fixes could mean there are literally thousands of slightly different
  350. variations of 3.2 in use. Please see section 6 to request some useful
  351. faxes to help with this number game.
  352.  
  353. AIX 3.2.4 and later attempts to resolve this confusion. The OS is
  354. broken down into subsystems so that updates can be applied to an entire
  355. subsystem.  lslpp also sports a new option; use 'lslpp -m bos.obj' to
  356. show what level and update the system is running. You can also use the
  357. new oslevel command. Unless you have a pressing need (such as
  358. applications unsupported on > 3.2.3), it is recommended that you update
  359. to this level. Also see 1.128.
  360.  
  361. ______________________________________________________________________________
  362. 1.100: I am used to Unix systems programming, why should I learn SMIT?
  363.  
  364. Using SMIT is probably very different from your normal way of doing
  365. system administration, but could prove very useful in the long run. In
  366. some areas, in particular TCP/IP, NFS, etc., you can also do things the
  367. normal way, but it is unfortunately difficult to know exactly when the
  368. normal way works. Again, always using SMIT is probably your best way
  369. to go, even when you have to learn a new tool. 
  370.  
  371. What SMIT actually does is build up commands with all required options
  372. to perform the functions requested and execute them. The commands
  373. called and the output they produce are stored in the files smit.script
  374. and smit.log in your home directory. Looking in smit.script may teach
  375. you more about system administration.
  376.  
  377.  
  378. 1.101: How do I turn off the "running man" in smit?
  379.  
  380. Use smitty, the standard curses version or add this line to your .kshrc file:
  381. alias smit="smit -C"
  382.  
  383.  
  384. 1.102: How do I import an /etc/passwd or /etc/group file from another box?
  385.  
  386. Make sure that you run usrck, pwdck (/etc/passwd), and grpck
  387. (/etc/group) to let AIX work its password/group magic.
  388.  
  389.  
  390. 1.103: Cleaning up utmp, who, and accounting problems
  391. From: fritz@scipp.UCSC.EDU (Frederick Staats)
  392.  
  393. This applies if you are running an X11R5 xterm on 3.2.
  394. Add this to the top of X11R5 mit/clients/xterm/main.c:
  395.  
  396. #ifdef AIXV3
  397. #define USE_SYSV_UTMP
  398. #define HAS_UTMP_UT_HOST
  399. #define WTMP_FILENAME "/var/adm/wtmp"
  400. #endif
  401.  
  402. And your utmp problems should go away. If you want xterminal sessions
  403. to go into the wtmp file you need to define -DWTMP in the Imakefile and
  404. be sure the WTMP_FILENAME is set to the right place.
  405.  
  406. The following program by jfh@rpp386.cactus.org (John F. Haugh)
  407. if run in the background by root will clean up the utmp file.
  408.  
  409. #include <sys/types.h>
  410. #include <utmp.h>
  411. #include <fcntl.h>
  412.  
  413. main ()
  414. {
  415.     int    fd;
  416.     struct    utmp    utmp;
  417.  
  418.     while (1) {
  419.         if ((fd = open ("/etc/utmp", O_RDWR)) < 0)
  420.             exit (1);
  421.  
  422.         while (read (fd, &utmp, sizeof utmp) == sizeof utmp) {
  423.             if (utmp.ut_type == USER_PROCESS &&
  424.                     kill (utmp.ut_pid, 0) != 0) {
  425.                 lseek (fd, - (long) sizeof utmp, 1);
  426.                 utmp.ut_type = DEAD_PROCESS;
  427.                 write (fd, &utmp, sizeof utmp);
  428.             }
  429.         }
  430.         close (fd);
  431.         sleep (60);
  432.     }
  433. }
  434.  
  435. Another utmp program was posted to comp.sources.unix, volume 25, issue
  436. 96 by David W. Sanderson (dws@cs.wisc.edu) that also works on AIX 3.1.
  437.  
  438.  
  439. 1.104: How to fsck the root filesystem
  440.  
  441. You can run fsck either in maintenance mode or on mounted filesystems.
  442. Try this:
  443.  
  444.   1. boot from diskette
  445.   2. select maintenance mode
  446.   3. type /etc/continue hdisk0 exit (replace hdisk0 with boot disk if
  447.      not hdisk0)
  448.   4. fsck /dev/hd4
  449.  
  450.  
  451. 1.105: How can I unmount /usr to run fsck on it?
  452. From: accapadi@mathew.austin.ibm.com (Matt Accapadi)
  453. [ This is for 3.2. ]
  454.  
  455. In order to fsck /usr, it has to be unmounted. But /usr cannot be
  456. unmounted because /bin is symbolically linked to /usr/bin. Also
  457. /etc/fsck is symbolically linked to /usr/sbin/fsck.
  458.  
  459. To work around this, when you boot from the boot/maintenance diskettes
  460. and enter maintenance mode, enter "getrootfs hdisk0 sh" instead of
  461. "getrootfs hdisk0" where hdisk0 is the name of the boot disk. Then run
  462. "fsck /dev/hd2".
  463.  
  464.  
  465. 1.106: How do I shrink /usr?
  466. From: mike@bria.UUCP (Michael Stefanik) and Richard Hasting
  467.  
  468. FOR AIX 3.1
  469. -----------
  470.  
  471.  1) Make a backup of /usr
  472.  
  473.         find /usr -print | backup -ivf /dev/rmt0 (or appropriate device)
  474.  
  475.  2) shutdown to maintenance mode
  476.  
  477.         shutdown -Fm
  478.  
  479.  3) export LANG=C
  480.  
  481.  4) remove the filesystem and the logical volume
  482.     ignore an error about the "dspmsg" command not found
  483.  
  484.         umount /usr
  485.         rmfs /usr
  486.  
  487.  5) make a new logical volume hd2 and place it on rootvg with desired size
  488.  
  489.         mklv -yhd2 -a'e' rootvg NNN 
  490.  
  491.    where NNN is the number of 4 meg partitions
  492.  
  493.  6) create a filesystem on /dev/hd2
  494.  
  495.         crfs -vjfs -dhd2 -m'/usr' -Ayes -p'rw'
  496.  
  497.  7) mount the new /usr filesystem and check it
  498.  
  499.         /etc/mount /usr
  500.         df -v
  501.  
  502.  8) restore from the tape; system won't reboot otherwise
  503.  
  504.         restore -xvf/dev/rmt0
  505.  
  506.  9) Sync and reboot the system; you now have a smaller /usr filesystem
  507.  
  508. FOR AIX 3.2
  509. -----------
  510.  
  511.  0)  Experiances posted to comp.unix.aix lead me to suggest that
  512.      many administrators find the following piece of information 
  513.      useful after completing this procedure.  I thought some of you
  514.      might like to read it BEFORE getting yourself into this
  515.      predicament.  
  516.  
  517.      Call 1-800-IBM-4FAX and request document 2503 dated 1/26/94.  
  518.      Title is "How to recover if all files are owned by root after
  519.      restoration from a mksysb tape".
  520.  
  521.  1) Remove any unneeded files from /usr.
  522.  
  523.  2) Make sure all filesystems in the root volume group are mounted. If
  524.     not, they will not be included in the re-installed system.
  525.  
  526.  3) Type mkszfile. This will create /.fs.size that contains a list of
  527.     the active filesystems in the root volume group that will be
  528.     included in the installation procedure.
  529.  
  530.  4) Edit .fs.size. Change the size of /usr to what you want.
  531.  
  532.     Example: This .fs.size file shows /usr to be 40MB.
  533.  
  534.     rootvg 4 hd2 /usr 10 40 jfs
  535.  
  536.     The 10 is the number of physical partitions for the filesystem and
  537.     the 40 is 40 MB. Most systems have a physical partition size of 4 MB.
  538.     Therefore, the second number (40) will always be 4 times the
  539.     previous number (10). Note, however, that a model 320 with a 120 MB
  540.     drive will have a physical partition size of only 2 MB, and the
  541.     total MB is twice the number of physical partitions. The first
  542.     number (4) in the .fs.size file represents the PP size.
  543.  
  544.     If you want to reduce the size of /usr from 40 MB to 32 MB, edit the
  545.     /usr entry to:
  546.  
  547.         rootvg 4 hd2 /usr 8 32 jfs
  548.  
  549.     IMPORTANT: Make sure that you DO NOT enter a value which is less
  550.     than the size of the filesystem required to contain the current
  551.     data. Doing so will cause the re-installation procedure to fail.
  552.  
  553.  5) chdev -l rmt0 -a block=512 -T
  554.  
  555.  6) Unmount all filesystems that are NOT in the root volume group.
  556.  
  557.  7) Varyoff all user-defined volume groups, if any
  558.  
  559.         varyoffvg VGname
  560.  
  561.  8) Export the user-defined volume groups, if any
  562.  
  563.         exportvg VGname
  564.  
  565.  9) With a tape in the tape drive, type
  566.  
  567.         mksysb /dev/rmt0
  568.  
  569.      This will do a complete system backup, which will include
  570.      information (in the .fs.size file) for the installation procedure
  571.      on how large the filesystems are to be created.
  572.  
  573.  10) Follow the instructions in the Installation Kit under "How to
  574.      Install and perform maintenance from Diskettes" (reportedly now 
  575.      called "BOS Installation from a System Backup") using the
  576.      diskettes and tape that you created in the previous steps.
  577.  
  578.      [ pre AIX 325: DO NOT select the option "Reinstall AIX with
  579.      Current System Settings". Instead use "Install AIX with Current
  580.      System Settings" for the logical volume size changes to take affect. ]
  581.  
  582.      [ w/ AIX 325: Select "Install from a mksysb image" ]
  583.  
  584.  11) When the installation is complete, you may then import any
  585.      user-defined volume groups.
  586.  
  587.          importvg -y VGname PVname
  588.  
  589.      where "VGname" is the name of the volume group, and "PVname" is
  590.      the name of any one of the physical volumes in the volume group.
  591.  
  592.  12) Varyon your user-defined volume groups
  593.  
  594.          varyonvg VGname
  595.  
  596.  The reduction of the filesystems is now complete.
  597.  
  598.  
  599. 1.107: How do I make a filesystem larger than 2Gb?
  600.  
  601. With AIX 4.1 IBM allows filesystems up to 64Gb (reference:
  602. http://www.austin.ibm.com/announce.0725.html).  Individual files are
  603. still limited to 2Gb.
  604.  
  605. If you are having trouble creating a file greater than 1Mb it maybe
  606. because that is the default limit for your account, see 'smit users'
  607. or /etc/security/limit.
  608.  
  609. The largest filesystem under AIX is 2 Gigabytes because the largest
  610. signed integer is 2**31 - 1.  This means that AIX 3.2.5 an versions
  611. preceeding it are limited to 2Gb filesystems.  This obviously does not
  612. include "non-filesystems"
  613.  
  614.  
  615. 1.108: How do I see/change parameters like number of processes per user?
  616.  
  617. You can use SMIT as described below or simply use lsattr/chdev.
  618. The former will list the current setting as in:
  619.  
  620.   # lsattr -E -l sys0 -a maxuproc
  621.   maxuproc 40 Maximum # of processes allowed per user True
  622.  
  623. and you can then increase the maxuproc parameter:
  624.  
  625.   # chdev -l sys0 -a maxuproc=200
  626.   sys0 changed
  627.  
  628. If you just type 'lsattr -E -l sys0' you will get a list of all
  629. parameters, some of which can be changed but not others.
  630.  
  631. If you want to use smit, do as follows:
  632.  
  633. smit
  634.   System Environments and Processes
  635.     Change / Show Operating System Parameters
  636.       - on this screen you can change by overtyping the following fields:
  637.         - Maximum number of PROCESSES allowed per user
  638.         - Maximum number of pages in block I/O BUFFER CACHE
  639.         - Maximum Kbytes of real memory allowed for MBUFS
  640.       - toggle fields exist for:
  641.         - Automatically REBOOT system after a crash  (false/true)
  642.         - Continuously maintain DISK I/O history (true/false)
  643.  
  644.  
  645. 1.109: How do I shrink the default paging space on hd6?
  646.  
  647. 1) create a paging space to use temporarily
  648.    mkps -s 20 -a rootvg
  649.  
  650. 2) change default paging space hd6 so it is not used at next reboot
  651.    chps -a n hd6
  652.  
  653. 3) For AIX 3.1, edit /etc/rc.boot4 and change swapon /dev/hd6;
  654.    for AIX 3.2, edit /sbin/rc.boot and change swapon /dev/hd6
  655.    swapon /dev/paging00
  656.  
  657. 4) Update information in boot logical volume
  658.    bosboot -a             (3.1)
  659.    bosboot -a -d hdisk0   (3.2)
  660.  
  661. 5) shutdown and reboot
  662.  
  663. 6) remove current hd6 and create a new one of smaller size
  664.    rmps hd6
  665.    mklv -y hd6 -t paging rootvg <size of PS in 4 Meg blocks>
  666.  
  667. 7) Re-edit /etc/rc.boot4 (3.1), /sbin/rc.boot (3.2) to swap to /dev/hd6
  668.    swapon /dev/hd6
  669.  
  670. 8) Update information in boot logical volume
  671.    bosboot -a             (3.1)
  672.    bosboot -a -d hdisk0   (3.2)
  673.  
  674. 9) change current paging device (paging00) so it is inactive at next boot
  675. v   chps -a n /dev/paging00
  676.  
  677. 10) shutdown, reboot, remove paging00 using the command:
  678.     rmps paging00
  679.  
  680. You can check your paging space with `lsps -a`
  681.  
  682. 1.110: The swapper seems to use enormous amounts of paging space, why?
  683.  
  684. When you run ps, you may see a line like:
  685.  
  686. USER   PID %CPU %MEM    SZ   RSS     TT STAT  TIME CMD
  687. root     0 0.0%  14% 386528  8688      -    S 17:06 swapper
  688.  
  689. This is normal behavior, the swapper looks to ps like it has the entire
  690. paging space plus real memory allocated.
  691.  
  692.  
  693. 1.111: How much paging space do I need?
  694.  
  695. See answer 2 in question 1.300.
  696.  
  697.  
  698. 1.112: How do I mount a floppy disk as a filesystem?
  699. From: op@holmes.acc.Virginia.EDU (Olaf Pors)
  700.  
  701. You can build a filesystem on a floppy and mount it, however the
  702. filesystem will be read only. The reason that the filesystem will be
  703. read only is because AIX Version 3.1.5 cannot create a journal log on a
  704. diskette. The intended use is for temporary access to read only data. 
  705. The diskette file system must be unmounted after use and during system
  706. backup procedures or errors could occur.
  707.  
  708. To make the read only filesystem on a floppy:
  709.  
  710. 1. Make a subdirectory on an existing filesystem and place all of the
  711.    files that the diskette will contain into this subdirectory.
  712.  
  713. 2. Enter the following command to create a prototype file containing
  714.    information about the new filesystem, in the example /dir_struct
  715.    is the pathname of the subdirectory created in step 1, and
  716.    proto_filename is the name of the prototype file to be created.
  717.  
  718.          proto /dir_struct > proto_filename
  719.  
  720. 3. Place a formatted floppy into the drive.
  721.  
  722. 4. Edit the prototype file and replace the first line with the following:
  723.  
  724.          <noboot> 0 0
  725.  
  726. 5. Enter the following command to make the filesystem on your floppy:
  727.  
  728.           mkfs -p proto_filename -V jfs /dev/fd0
  729.  
  730. 6. Create the directory upon which you will mount the floppy based
  731.    filesystem, or you can use /mnt. Mount the filesystem:
  732.  
  733.           mount -r -V jfs /dev/fd0 /your_mount_point
  734.  
  735. 7. To unmount the filesystem:
  736.  
  737.           umount /dev/fd0
  738.  
  739. Since the filesystem is read-only it may be of limited use but if you
  740. are going to use it for utility programs and other data that does not
  741. change much, it may still be useful. If you need to change the data,
  742. you can copy the directory from the floppy into another directory, make
  743. your modifications, and remake the filesystem using this procedure.
  744.  
  745.  
  746. 1.113: How do I remove a committed lpp?
  747.  
  748. [Ed note: This section is getting a little confusing, with the
  749. addition of other methods, and is now on my list for restructuring.
  750. As always I'm open to comments as to how to make it more clear.]
  751.  
  752. The correct way to get rid of COMMITTED lpps/ ptfs is to Force apply
  753. the lpp, and reject.
  754.  
  755. AIX 4.1 users: installp has a new option, uninstall (-u) which can be
  756. used to remove lpps.
  757.  
  758. The correct way to get rid of BROKEN ptfs is to use the
  759. apply-commit-nosave options and not using any of the scripts available
  760. which might hide the the problem on a short term basis.
  761.  
  762. The following script for 3.2 only is from IBM NZ AIX software
  763. support. As far as I know, it works -- I used it to remove unwanted
  764. fonts. I have no official permission to post it -- use it at your own
  765. risk!  drb@chmeds.ac.nz (Ross Boswell)
  766.  
  767. #!/bin/ksh
  768. #
  769. # Permanently remove a product from disk and AIX databases
  770. #
  771.  
  772. if [ `whoami` != "root" ] ; then
  773.   echo You must be root to run this script.
  774.   exit 1
  775. fi
  776.  
  777. if [ `uname -a | awk '{print $1$4$3}'` != "AIX32" ] ; then
  778.   echo This script only works on AIX 3.2.
  779.   exit 1
  780. fi
  781.  
  782. TMP_FREE=`df /tmp | awk '$3 ~ /[0-9]/{print $3}'`
  783. if [ "$TMP_FREE" -lt 1000 ] ; then
  784.    echo There is not enough room in your /tmp directory.
  785.    echo You need 1000 KB free, and you have only $TMP_FREE KB free.
  786.    echo Either remove some stuff from /tmp, or use chfs to make it bigger.
  787.    exit 1
  788. fi
  789.  
  790. ODMDIRS="/etc/objrepos /usr/lib/objrepos /usr/share/lib/objrepos"
  791. ODMDIR=/usr/lib/objrepos
  792. export ODMDIR
  793.  
  794. if [ $# -lt 1 ]
  795. then
  796.   echo usage: $0 lppname [lppname ...]
  797.   echo lppname is a string compatible with grep, ie "X11" or "PHIGS"
  798.   echo typing   $0 PHIGS   will remove all LPPs with PHIGS in their name.
  799.   exit 1
  800. fi
  801.  
  802. NAMES=$1
  803. shift
  804. while [ $# -gt 0 ] ; do
  805.   NAMES="$NAMES|$1"
  806.   shift
  807. done
  808. echo "Searching for lpps with egrep \"$NAMES\"...\c"
  809.  
  810. for ODMDIR in $ODMDIRS ; do
  811.   if [ ! -d $ODMDIR -o ! -w $ODMDIR ] ; then
  812.      echo $ODMDIR is not writeable or is not a directory.
  813.      echo I hope this is because you are a /usr client or diskless.
  814.      echo If you are not a diskless or a /usr client, you should stop.
  815.      echo "Enter y to continue ->\c"
  816.      read answer
  817.      if [ "$answer" != "y" ] ; then
  818.        exit 0
  819.      fi 
  820.   fi
  821.   TMP=`odmget lpp | awk -F\" '/name/ {print $2}' | egrep "$NAMES"`
  822.   LPPS=`echo $LPPS $TMP`
  823. done
  824.  
  825. if [ "$LPPS" = "" ]
  826. then
  827.   echo "failed.\nNo LPP with the name $NAMES detected."
  828.   exit 1
  829. fi
  830. echo ok.
  831.  
  832. for ODMDIR in $ODMDIRS ; do
  833.   mkdir -p /tmp/rmlpp/$ODMDIR > /dev/null 2>&1
  834. done
  835.  
  836. > /tmp/listOfFilesToRM$$    # truncate temporary file, just in case.
  837. echo
  838. echo This script is about to attempt to remove an LPP from your system.
  839. echo I say attempt, because it could fail.  If it fails, you may have
  840. echo to at least reload the LPP.  Use the \"lppchk\" command to make sure
  841. echo all is well with your system.
  842. echo
  843. # Loop through all the LPP names found.
  844. for LPP in $LPPS
  845. do
  846.   DESCR=none
  847.   answer=""
  848.  
  849.   # find the LPP ids.  They will be different in the three SWVPD databases.
  850.   for ODMDIR in $ODMDIRS ; do
  851.     # get the lpp id for this ODMDIR (yes, they are different)
  852.     LPPID=`odmget -q name=$LPP lpp | grep lpp_id | sed 's/.* = //'`
  853.  
  854.     # did we find the LPP?
  855.     if [ "$DESCR" = "none" -a "$LPPID" != ""  ] ; then
  856.       # all the descriptions should be the same
  857.       DESCR=`odmget -q name=$LPP lpp | grep description | sed 's/.* = //'`
  858.       echo "Delete $LPP, $DESCR?"
  859.       echo "y or (n) ->\c"
  860.       read answer
  861.       if [ "$answer" != "y" ] ; then # jump back up to the next LPP name
  862.         continue 2
  863.       fi
  864.     fi
  865.     # if there is no DESCR, then we didn't find the LPP.  Weird.
  866.     if [ "$DESCR" = "none" -o "$LPPID" = "" ] ; then
  867.       continue
  868.     fi
  869.     SOMETHING_DONE_FLAG=true
  870.     # Optionally, save the ODM stuff we are about to remove,
  871.     # in case something goes wrong.  The problem is it is difficult
  872.     # to determine if something really did fail, since these commands
  873.     # don't return any decent error return codes.
  874.     odmget -q lpp_id=$LPPID history   > /tmp/rmlpp/$ODMDIR/$LPP.history
  875.     odmget -q name=$LPP lpp           > /tmp/rmlpp/$ODMDIR/$LPP.lpp
  876.     odmget -q lpp_name=$LPP product   > /tmp/rmlpp/$ODMDIR/$LPP.product
  877.     # Get the list of files and links to remove later....
  878.     odmget -q lpp_id=$LPPID inventory > /tmp/rmlpp/$ODMDIR/$LPP.inventory
  879.     awk -F\" '/loc/ {print $2}' /tmp/rmlpp/$ODMDIR/$LPP.inventory | \
  880.       sed 's/,/ /g' >> /tmp/listOfFilesToRM$$
  881.     odmdelete -o history -q lpp_id=$LPPID   > /dev/null 2>&1
  882.     odmdelete -o lpp -q name=$LPP           > /dev/null 2>&1
  883.     odmdelete -o product -q lpp_name=$LPP   > /dev/null 2>&1
  884.     odmdelete -o inventory -q lpp_id=$LPPID > /dev/null 2>&1
  885.   done
  886. done
  887.  
  888. if [ "$SOMETHING_DONE_FLAG" = "true" ] ; then
  889.  
  890.   echo ODM work is done.  Now, time to delete files....
  891.  
  892.   # This could be catastrophic if there is a problem.  For example,
  893.   # if the ODM database for an application had / as one of its files.
  894.   # You be the judge.  Here's your rope....
  895.   cat /tmp/listOfFilesToRM$$ | sort -r | uniq | xargs rm -rf
  896.  
  897.   rm -rf /tmp/listOfFilesToRM$$
  898.   echo done.
  899. fi
  900.  
  901. # take this line out if you want to save your ODM saved files.
  902. rm -rf /tmp/rmlpp
  903.  
  904. exit 0
  905.  
  906.  
  907. 1.114: How can I recover space after installing updates?
  908. From: Milt Cloud <cloud@ux1.cso.uiuc.edu>
  909.  
  910. Note: If you are a /usr server, do not use this because the files
  911.       mentioned below are needed by /usr clients and cannot be deleted.
  912.  
  913. Installp creates numerous files in /usr to clean up after
  914. failed/rejected installs and also for de-installing uncommitted lpps. 
  915. Once you have COMMITted packages you can remove these files safely. 
  916. Depending on your installation activity the numbers can be significant:
  917. hundreds-to-thousands of files, megabytes of data.
  918.  
  919. Files eligible for removal are associated with each "product" you have
  920. installed; the largest collection being due to bos. After
  921. COMMITting bos lpps, you may safely remove all files of the form:
  922.  
  923.               /usr/lpp/bos/deinstl*
  924.               /usr/lpp/bos/inst_U4*
  925.               /usr/lpp/bosadt/deinstl*
  926.         and   /usr/lpp/bosadt/inst_U4*
  927.  
  928. You may repeat this for all additional COMMITted products (e.g.,
  929. bostext1, bosnet, xlc) you have on your system.
  930.  
  931. This problem of lingering install files is a known defect in installp. 
  932. If you have installed PTF U411711 (or any superseder of it: U412397,
  933. U413366, U413425) the deadwood in /usr will not be quite as prevalent. 
  934. No single PTF currently available completely corrects this problem.
  935.  
  936. On my own 320, the following freed up 12.4M in /usr:
  937.  
  938.        # rm -R /usr/lpp/bos/deinstl*
  939.        # rm -R /usr/lpp/bos/inst_U4*
  940.  
  941.  
  942. 1.115: Where are the AIX log files kept?
  943. From: dirk@kimosabi.ucsc.edu (Dirk Coldewey)
  944.  
  945. AIX logs messages as specified in /etc/syslog.conf.  Here's an
  946. example
  947.  
  948. #
  949. *.err;kern.debug;auth.notice;user.none          /dev/console
  950. *.err;kern.debug;daemon,auth.notice;mail.crit;user.none /var/adm/messages
  951. lpr.debug                                       /var/adm/lpd-errs
  952.  
  953. *.alert;kern.err;daemon.err;user.none           operator
  954. *.alert;user.none                               root
  955. *.emerg;user.none                               *
  956.  
  957. # for loghost machines, to have authentication messages (su, login, etc.)
  958. # logged to a file, un-comment out the following line and adjust the 
  959. # file name as appropriate.
  960. #
  961. # if a non-loghost machine chooses to have such messages 
  962. # sent to the loghost machine, un-comment out the following line.
  963. #
  964. auth.notice                     /var/log/authlog
  965. mail.debug                      /var/log/syslog
  966.  
  967. # following line for compatibility with old sendmails. they will send
  968. # messages with no facility code, which will be turned into "user" messages
  969. # by the local syslog daemon. only the "loghost" machine needs the following
  970. # line, to cause these old sendmail log messages to be logged in the
  971. # mail syslog file.
  972. #
  973. user.alert                       /var/log/syslog
  974. #
  975. # non-loghost machines will use the following lines to cause "user"
  976. # log messages to be logged locally.
  977. #
  978. user.err                         /dev/console
  979. user.err                         /var/adm/messages
  980. user.alert                       `root, operator'
  981. user.emerg                       *
  982.  
  983.  
  984. 1.116: How can I log information about ftp accesses to a file?
  985. From: elr@trintex.uucp (Ed Ravin) and
  986.       map@hal.maths.monash.edu.au (Michael Page)
  987.  
  988. 1) In /etc/syslog.conf, add the line:
  989.    daemon.debug        /tmp/daemon.log
  990.  
  991. 2) # touch  /tmp/daemon.log
  992.    # refresh -s syslogd
  993.  
  994. 3) Modify your inetd.conf so that ftpd is called with the "-l" flag.
  995.    You may also want the "-d" flag. This can be done with 'smit inetdconf'.
  996.  
  997. All the syslog messages from various system daemons should now appear in
  998. the file "/tmp/daemon.log".
  999.  
  1000.  
  1001. 1.117: How do I find a file name from the inode number?
  1002. From: svpillay@berlioz.crs4.it (Kanthan Pillay)
  1003.  
  1004.      find /mntpoint -xdev -inum nnnn -print
  1005.  
  1006.  
  1007. 1.118: How do I set up postscript accounting?
  1008. From: taluskie@utpapa.ph.utexas.edu (Vince Taluskie)
  1009.  
  1010. Ephraim Vider originally wrote this program to configure postscript page
  1011. accounting. It acts as a backend wrapper which logs accounting
  1012. information in /etc/qconfig and can be ftp'd from utpapa.ph.utexas.edu
  1013. in /pub/aix/psacct.tar.Z.
  1014.  
  1015. Compile with:
  1016.  
  1017. cc  pswrap.c -o pswrap -lqb
  1018.  
  1019. and then make this program suid root:
  1020.  
  1021. chown root pswrap
  1022. chmod u+s pswrap
  1023.  
  1024. If this step is not done, the printer will hang.
  1025.  
  1026. Then start up SMIT and go to :
  1027.  
  1028. Spooler
  1029.   Manage Local Printer Subsystem
  1030.     Local Printer Queue Devices
  1031.       Change / Show Characteristics of a Queue Device
  1032.         <Select Queue>
  1033.           <Select Device>
  1034.  
  1035. and change "BACKEND PROGRAM pathname" to the full pathname of pswrap
  1036. since pswrap will now handle the backend interface with the queue.
  1037.  
  1038. A stream of info will be written to a logfile in /tmp (prob lp0.log) but
  1039. this file is mainly used for status info and raw pagecounts. If the
  1040. accounting data is going to the qconfig-specified acctfile, then use the
  1041. 'pac' command to read it. I prefer to have readable ascii data files
  1042. instead, so I just comment out the '#define WANT_PAC' line and it will
  1043. only go to the ACCTFILE specfied in pswrap.c.
  1044.  
  1045. /*  pswrap.c
  1046.  
  1047.  compile with:   cc pswrap.c -o pswrap -lqb
  1048.  (for doc on the qb library see "understanding backend routines in libqb")
  1049.  
  1050.  BTW:  The log_charge() function doesn't seem to do anything,
  1051.        but log_pages() updates the accounting info.
  1052.  
  1053. Ephraim Vider, original author 
  1054.  
  1055. --
  1056. Feb 10, 1993
  1057.  
  1058. You can set pswrap up to use either the accounting file specified in
  1059. /etc/qconfig (which means that you need to get your data from 'pac') or
  1060. you can comment out the #define WANT_PAC line and then the accounting
  1061. data will only go into the ACCTFILE.
  1062.  
  1063. Also modified the logging to the ASCII acctfile so that it looks more
  1064. readable.
  1065.  
  1066. Vince Taluskie
  1067. */
  1068.  
  1069.  #include <stdio.h>
  1070.  #include <string.h>
  1071.  #include <ctype.h>
  1072.  #include <fcntl.h>
  1073.  #include <signal.h>
  1074.  #include <setjmp.h>
  1075.  #include <sys/wait.h>
  1076.  #include <IN/backend.h>
  1077.  #include <IN/standard.h>
  1078.  #include "qprocs.h"
  1079.  
  1080.  char     *nextword (char *p);
  1081.  char     *skipvalue (char *p);
  1082.  
  1083.  #define LOGDIR     "/tmp"
  1084.  #define ACCTFILE   "/usr/adm/acct/lpr/ps-acct"
  1085. /* #define WANT_PAC     1 */     /* this define will also send accounting
  1086.                                  info to the acctfile specified in
  1087.                  /etc/qconfig file.  If this define is 
  1088.                  commented out then accounting info will
  1089.                  only go to ACCTFILE  */
  1090.  
  1091.  
  1092.  char     pcprog[] = "statusdict begin pagecount = end\n\x04";
  1093.  
  1094.  char     *keyw[] = {
  1095.      "idle",
  1096.      "busy",
  1097.      "waiting",
  1098.      "printing",
  1099.      "initializing",
  1100.      NULL
  1101.  };
  1102.  enum     { PS_IDLE, PS_BUSY, PS_WAIT, PS_PRINT, PS_INIT, PS_UNKNOWN };
  1103.  
  1104.  void     giveup();
  1105.  jmp_buf  jumper;
  1106.  
  1107.  char     logfname[30];
  1108.  FILE     *logfile, *acctfile;
  1109.  
  1110.  main (argc, argv)
  1111.  int argc;
  1112.  char     *argv[];
  1113.  {
  1114.      char *devname;
  1115.      int  pagcnt, c;
  1116.      int  pid;
  1117.      int  w, status;
  1118.  
  1119.      if (argc < 2) {
  1120.           fprintf(stderr, "Usage: psbe file\n");
  1121.           exit(-1);
  1122.      }
  1123.      if (log_init(argv[1]) < 0) {
  1124.           fprintf(stderr, "log_init failed!\n");
  1125.           exit(EXITBAD);
  1126.      }
  1127.      sprintf(logfname, "%s/%s.log", LOGDIR, get_device_name());
  1128.      if ((logfile = fopen(logfname, "a")) == NULL) {
  1129.           fprintf(stderr, "Can't open logfile.\n");
  1130.           exit(EXITBAD);
  1131.      }
  1132.  
  1133.      if ((acctfile = fopen(ACCTFILE, "a")) == NULL) {
  1134.      fprintf(stderr, "Can't open logfile.\n");
  1135.      exit(EXITBAD);
  1136.      }
  1137.  
  1138.      setvbuf(logfile, NULL, _IOLBF, BUFSIZ);
  1139.      setvbuf(acctfile, NULL, _IOLBF, BUFSIZ);
  1140.  
  1141.      setvbuf(stdin, NULL, _IONBF, 0);
  1142.      setvbuf(stdout, NULL, _IONBF, 0);
  1143.      fprintf(logfile, "start Job no. %d, queued on %s\n", get_job_number(),
  1144.                get_qdate());
  1145.      log_status(WAITING);
  1146.      pagcnt = getpagecnt();
  1147.      log_status(RUNNING);
  1148.      if ((pid = fork()) < 0) {
  1149.           perror("fork");
  1150.           exit(EXITBAD);
  1151.      }
  1152.      if (pid == 0) {
  1153.           argv[0] = "piobe";
  1154.           execv("/usr/lpd/piobe", argv);
  1155.           perror("exec");
  1156.           exit(EXITBAD);
  1157.      }
  1158.      while ((w = wait(&status)) != pid)
  1159.           if (w == -1) {
  1160.                perror("wait");
  1161.                exit(EXITBAD);
  1162.           }
  1163.      if (WEXITSTATUS(status) != 0)
  1164.           exit(WEXITSTATUS(status));
  1165.      log_status(WAITING);
  1166.  
  1167.      if (pagcnt > 0 && (c = getpagecnt()) > 0) {
  1168. #ifdef WANT_PAC 
  1169.           log_pages(c - pagcnt);
  1170. #endif
  1171.     }
  1172.  
  1173.      fprintf(logfile, "end Job no. %d, queued on %s\n", get_job_number(),
  1174.                get_qdate());
  1175.  
  1176. /* the accounting file format is 
  1177.  
  1178. pages_printed     user     queue_printed_on   time_queued
  1179.  
  1180. */
  1181.  
  1182.      fprintf(acctfile, "%d %35s %7s    %s \n", (c - pagcnt), get_from(), get_queue_name(), get_qdate());
  1183.  
  1184.      fclose(logfile);
  1185.      fclose(acctfile);
  1186.      exit(EXITOK);
  1187.  }
  1188.  
  1189.  void     giveup ()
  1190.  {
  1191.      longjmp(jumper, 1);
  1192.  }
  1193.  
  1194.  getpagecnt ()
  1195.  {
  1196.      int  pc = 0, pstat;
  1197.      char buf[81];
  1198.  
  1199.      if (setjmp(jumper) != 0) {
  1200.           fprintf(logfile, "giving up on status\n");
  1201.           return (0);
  1202.      }
  1203.      alarm(60 * 2);
  1204.      signal(SIGALRM, giveup);
  1205.      do {
  1206.           if (!gets(buf)) {
  1207.                sleep(5);
  1208.                putchar('\x14');    /* ^T returns status */
  1209.                sleep(1); /* wait for answer from printer */
  1210.                if (!gets(buf))
  1211.                     return (0);
  1212.           }
  1213.           fprintf(logfile, "%s\n", buf);
  1214.           if ((pstat = getstatus(buf)) == PS_WAIT) {
  1215.                putchar('\x04');
  1216.                sleep(1);
  1217.           }
  1218.      } while (pstat != PS_IDLE);
  1219.      alarm(0);
  1220.      while (gets(buf))
  1221.           fprintf(logfile, "%s\n", buf);
  1222.      printf("%s", pcprog);
  1223.      sleep(1); /* wait for answer from printer */
  1224.      if (!gets(buf))
  1225.           return (0);
  1226.      if (sscanf(buf, "%d", &pc) != 1)
  1227.           return (0);
  1228.      fprintf(logfile, "%d\n", pc);
  1229.      return (pc);
  1230.  }
  1231.  
  1232.  /*
  1233.   * Parser for printer status messages
  1234.   */
  1235.  
  1236.  getstatus (p)
  1237.  char     *p;
  1238.  {
  1239.      char *t;
  1240.      int  i;
  1241.  
  1242.      if ((p = strchr(p, '%')) == NULL)
  1243.           return (PS_UNKNOWN);
  1244.      if (strncmp(p, "%%[", 3) != 0)
  1245.           return (PS_UNKNOWN);
  1246.      for (p = nextword(p + 3) ; p != NULL ; p = skipvalue(p)) {
  1247.           t = p;
  1248.           p = strchr(p, ':');
  1249.           *p++ = '\0';
  1250.           p = nextword(p);
  1251.           if (strcmp(t, "status") == 0)
  1252.                break;
  1253.      }
  1254.      if (p == NULL)
  1255.           return (PS_UNKNOWN);
  1256.      t = p;
  1257.      p = strchr(p, ' ');
  1258.      if (p[-1] == ';')
  1259.           p--;
  1260.      *p = '\0';
  1261.      for (i = 0 ; keyw[i] != NULL ; i++)
  1262.           if (strcmp(t, keyw[i]) == 0)
  1263.                break;
  1264.      return (i);
  1265.  }
  1266.  
  1267.  char     *nextword (p)
  1268.  char     *p;
  1269.  {
  1270.      while (isspace(*p))
  1271.           p++;
  1272.      if (strncmp(p, "]%%", 3) == 0)
  1273.           return (NULL);
  1274.      return (p);
  1275.  }
  1276.  
  1277.  char     *skipvalue (p)
  1278.  char     *p;
  1279.  {
  1280.      char *t;
  1281.  
  1282.      while (p != NULL) {
  1283.           p = strchr(p, ' ');
  1284.           t = p;
  1285.           p = nextword(p);
  1286.           if (t[-1] == ';')
  1287.                break;
  1288.      }
  1289.      return (p);
  1290.  }
  1291.  
  1292.  /*********    qprocs.h    ***********/
  1293.  /* functions for communication between qdaemon and the backend */
  1294.  
  1295.  char     *get_from();
  1296.  char     *get_to();
  1297.  char     *get_qdate();
  1298.  char     *get_queue_name();
  1299.  char     *get_device_name();
  1300.  char     *get_title();
  1301.  
  1302.  
  1303. 1.119: How do I create boot diskettes for 3.2?
  1304.  
  1305. You need to have four formatted diskettes.
  1306.  
  1307. boot disk:                bosboot -d /dev/fd0 -a
  1308. display disk:             mkdispdskt
  1309. display extension disk:   mkextdskt
  1310. Install/Maintenance disk: mkinstdskt
  1311.  
  1312.  
  1313. 1.120: Where can I find tools for performance monitoring?
  1314.  
  1315. Free X based performance watcher: xsysstats - ftp site ftp.x.org:/contrib
  1316.  
  1317. For 3.2 a few tools are available in /usr/lpp/bosperf. There are tools
  1318. to monitor traces, I/O events, CPU, virtual memory, disk block usage,
  1319. kernel extensions, etc. It even has a simulator, rmss, that allows one
  1320. to try out different memory size configurations to see how it impacts
  1321. performance. See 6.05 for the AIX Performance and Tuning Guide.
  1322.  
  1323. Monitor is an excellent tty based program that includes:
  1324.  
  1325.  - cpu usage
  1326.  - load average (from kernel or by using loadavgd program)
  1327.  - virtual and real memory usage
  1328.  - paging information
  1329.  - process events
  1330.  - Disk I/O (summary and TOP disks 1.12)
  1331.  - TTY I/O
  1332.  - Network activity
  1333.  - top cpu users 
  1334.  - NFS operations (New to 1.11)
  1335.  - more detailed disk I/O screen (New to 1.11 with -disk option)
  1336.  - more detailed network I/O screen (New to 1.12 with -net option)
  1337.  - toggle between normal/top/net/disk display using t,n,d keys
  1338.  
  1339. Monitor is available from
  1340. ftp.funet.fi:pub/unix/AIX/RS6000/monitor-1.11.tar.Z
  1341.  
  1342.  
  1343. 1.121: How can I tell what virtual printer a print queue is using?
  1344. From: yoder@austin.ibm.com (Stuart R. Yoder)
  1345.  
  1346. Use the command 'lsvirprt'. Don't use any parameters and it will
  1347. run in an interactive mode that will give you a menu of all virtual
  1348. printers on the system with the queue and device for each one.
  1349.  
  1350.  
  1351. 1.122: Two srcmstr's are less useful than one?
  1352. From: hubert@rs530.ncs.mainz.ibm.com (Bernhard Zeller)
  1353.  
  1354. This can happen on systems that have no console, or systems with an
  1355. async terminal as the console but not attached or turned off. One of the
  1356. symptoms is a second srcmstr got run. But the second srcmstr is worthless
  1357. as we can't use the stop/startsrc commands, refresh inetd, qdaemon won't
  1358. start, etc.
  1359.  
  1360. To resolve this, type:
  1361.  
  1362.     smit chgtty
  1363.  
  1364. and add the keyword 'clocal' in following lines:
  1365.  
  1366.    STTY attributes for RUN TIME
  1367.    STTY attributes for LOGIN
  1368.  
  1369.  
  1370. 1.123: How do I set the tty name associated with a physical port?
  1371. From: accapadi@mathew.austin.ibm.com (Matt Accapadi)
  1372.  
  1373. Let's say you wanted to make a tty on the s1 port and call it rs0000
  1374. and a tty on the s2 port and call it rs0001.
  1375.  
  1376. You could run:
  1377.  
  1378. mkdev -c tty -s rs232 -t tty -l rs0000 -p sa0 -w s1   # creates rs0000
  1379. and
  1380. mkdev -c tty -s rs232 -t tty -l rs0001 -p sa1 -w s2   # creates rs0001
  1381.  
  1382.  
  1383. 1.124: How do I use mksysb to clone a system?
  1384. From: joann@ariadne.SLAC.Stanford.EDU (Jo Ann Malina)
  1385.  
  1386. I use the following steps on the master machine to clone an AIX system:
  1387. 1) Remove the password from root.
  1388. 2) Remove the NIS line from the end of the /etc/group file (the last
  1389.    line with the +: )
  1390. 3) Change most of the level '2' designations in /etc/inittab to level
  1391.    '3' to prevent them from being started up when the new system is
  1392.    booted (the minimum ones to change are rc.nfs and rc.tcpip)
  1393. 4) Boot in service mode and change the name and ip address to a "spare"
  1394.    set to avoid address collision.
  1395. 5) Clear /tmp, /usr/tmp and /usr/spool/lpd/stat.
  1396. 6) Run mkszfile and edit it to be sure /usr is as small as possible;
  1397.    then mksysb from the command line.
  1398.  
  1399. The above changes allow me to boot in normal mode the first time, get in
  1400. as root, change the above files back and do the other things necessary
  1401. to configure the new system.
  1402.  
  1403. Then, of course, I go back and clean up and reboot my master machine.
  1404.  
  1405. Note: 1 and 2 lets you log in even if you can't get on the network. 
  1406.    It prevents the login process from trying to reach an NIS server. 
  1407.    Step 2 needed only if you use NIS.
  1408.  
  1409.  
  1410. 1.125: How do I retain timestamps with mksysb?
  1411. Originally From: graeme@ccu1.aukuni.ac.nz ( Graeme Moffat)
  1412.  
  1413. As of AIX 3.2.5 bosrest preserves timestamps and permissions as does pax.
  1414.  
  1415. In AIX 3.2.2 /usr/lpp/bosinst/bosnet (for net installs), and bosrest
  1416. (tape), the 'pax' commands all have '-pmop' options.  m = "DON'T
  1417. retain modification times".  So, simply change all the '-pmop' to
  1418. '-pop' and remake inst/maint diskettes or mksysb tapes.
  1419.  
  1420.  
  1421. 1.126: How can I find out the machine type?
  1422. From: umar@compsci.cas.vanderbilt.edu (Sait Umar)
  1423.  
  1424. #!/bin/sh
  1425. #
  1426. #  Author G. Vitillaro              (peppe@ipgaix.unipg.it)
  1427. #  from an idea of Marc Pawliger    (marc@ibmpa.awdpa.ibm.com)
  1428. #
  1429. #  10/12/92  GVT  First (and last) implementation
  1430. #
  1431. # machine : will get machine type on RISC/6000
  1432. #
  1433. #
  1434. awk '
  1435.         BEGIN {
  1436.                 m["10"]="7013/530 or 7016/730";
  1437.                 m["11"]="7013/540";
  1438.                 m["14"]="7013/540";
  1439.                 m["18"]="7013/530H";
  1440.                 m["1C"]="7013/550";
  1441.                 m["20"]="7015/930";
  1442.                 m["2E"]="7015/950";
  1443.                 m["2E"]="7015/950E";
  1444.                 m["30"]="7013/520";
  1445.                 m["31"]="7012/320";
  1446.                 m["34"]="7013/520H";
  1447.                 m["35"]="7012/320H or 320E";
  1448.                 m["37"]="7012/340";
  1449.                 m["38"]="7012/350";
  1450.                 m["41"]="7011/220";
  1451.                 m["43"]="7011/M20";
  1452.                 m["46"]="250/PowerPC";
  1453.                 m["47"]="230/RSC";
  1454.                 m["57"]="7012/390";
  1455.                 m["5C"]="7013/560";
  1456.                 m["63"]="7015/970";
  1457.                 m["64"]="7015/980";
  1458.                 m["66"]="7015/580";
  1459.                 m["67"]="7015/570";
  1460.         m["70"]="590/POWER2";
  1461.             m["71"]="580H";
  1462.                 m["75"]="7012/370, 375, or 37T";
  1463.                 m["76"]="7012/360, 365, or 36T";
  1464.                 m["77"]="7012/350, 355, or 7013/550L";
  1465.                 m["78"]="7012/315 or 7013/510 ";
  1466.             m["80"]="990/POWER2";
  1467.  
  1468.     You should request anyone with a model N40 run 'uname -m | cut -c9-10'
  1469.     so you can add an entry for it.
  1470.                 if ( m[code] != "" )
  1471.                         print "This RISC/6000 is a " m[code];
  1472.                 else
  1473.                         print "Unknown Machine";
  1474.         }
  1475. ' code=`uname -m | cut -c9-10` < /dev/null
  1476.  
  1477.  
  1478. 1.127: Updating to 3.2.5
  1479. From: kraemerf@franvm3.VNET.IBM.COM (Frank Kraemer)
  1480.  
  1481. (Ed.  The following is useful if you have to update a large number of
  1482. systems, large being > 3.)
  1483.  
  1484.    *** WARNING : Modify the scripts if you need dataless, diskless   ***
  1485.    ***           or remote /usr support.                             ***
  1486.  
  1487. 1) Receive the PMP3250 tape from your AIX support center the PTF number
  1488.    is U493250.
  1489.  
  1490. 2) Create a filesystem with 240 MB of space (60 PP's) and mount it as
  1491.  
  1492.    /dev/pmp3250  -  /pub/pmp3250
  1493.  
  1494. 3) Insert the tape (blocksize is 512) and install PTF U422467
  1495.  
  1496.    # installp -BXacgq -d /dev/rmt0 bos.obj 3.2.0.0.U422467
  1497.  
  1498. 4) Use the following script to load the tape in the new filesystem
  1499.  
  1500.    # cd /pub/pmp3250
  1501.    # mktape2disk.sh 0 447             <<-- read 447 files from rmt0
  1502.  
  1503. =-=-=-=-=-=-=-= cut here =-=-=-=-=-=-=-=-=-=-=
  1504. #!/bin/ksh
  1505. # @(#) mktape2disk.sh  creates files from tape on disk.
  1506.  
  1507. # change name prefix here
  1508. NAME="f"
  1509.  
  1510. # from file #i to file #j
  1511. integer i=1
  1512. integer j
  1513.  
  1514. # test arguments
  1515. if [ -z "${1}" ]
  1516. then
  1517.   echo "\nusage: $(basename ${0}) <drive_no> <#files>\n"
  1518.   echo "\t<drive_no>: tape drive number (e.g. 0)"
  1519.   echo "\t<#files>  : number of files to copy from the tape\n"
  1520.   exit 1
  1521. fi
  1522. device=/dev/rmt${1}.1
  1523.  
  1524. # test arguments
  1525. if [ -z "${2}" ]
  1526. then
  1527.   echo "\nusage: $(basename ${0}) <drive_no> <#files>\n"
  1528.   echo "\t<drive_no>: tape drive number (e.g. 0)"
  1529.   echo "\t<#files>  : number of files to copy from the tape\n"
  1530.   exit 1
  1531. fi
  1532. j=${2}
  1533.  
  1534. tctl -f ${device} rewind
  1535. if [ $? -ne 0 ]
  1536. then
  1537.   exit 1
  1538. fi
  1539.  
  1540. # create tape
  1541. while [ ${i} -le ${j} ]
  1542. do
  1543.     echo "Copy file #${i} of #${j} from (${device}) to disk as (${NAME}${i})."
  1544.     dd if=${device} of="${NAME}${i}" bs=200k
  1545.     i=i+1
  1546. done
  1547. tctl -f ${device} rewind
  1548. exit 0
  1549. =-=-=-=-=-=-=-= cut here =-=-=-=-=-=-=-=-=-=-=
  1550.  
  1551. 5) Create a new .toc file
  1552.  
  1553.    # cd /pub/pmp3250
  1554.    # inutoc .
  1555.    # pg .toc
  1556.  
  1557. 6) Place the following file named 'runme.sh' in the PMP directory
  1558.  
  1559. =-=-=-=-=-=-=-= cut here =-=-=-=-=-=-=-=-=-=-=
  1560. #!/bin/ksh
  1561. # @(#) runme.sh for PMP3250
  1562. #
  1563. INSTP="/usr/sbin/installp"
  1564. LOG="/tmp/installp.log"
  1565. TEE="/usr/bin/tee"
  1566. PATCHDIR=$(pwd)
  1567. #
  1568. /usr/bin/cp /usr/lpp/info/data/ispaths /usr/lpp/info/data/ispaths.save
  1569. #
  1570. INFODIR="/usr/lpp/info/$LANG/aixmin"
  1571. /usr/bin/mkdir ${INFODIR} 2>/dev/null >/dev/null
  1572. if [ ! -w ${INFODIR} ]
  1573. then
  1574.     print "\n\t*ERROR* Can not (write) access [${INFODIR}]."
  1575.     print "\tPlease unmount CD or NFS filesystems.\n"
  1576.     exit -1
  1577. fi
  1578. #
  1579. # Commit all ptf's
  1580. #
  1581. ${INSTP} -Xc all 2>&1 | ${TEE} ${LOG}.0
  1582. #
  1583. # Install latest installp patch
  1584. #
  1585. ${INSTP} -BXacgq -d ${PATCHDIR} bos.obj 3.2.0.0.U422463 2>&1 | ${TEE} ${LOG}.1
  1586. #
  1587. # Install latest installp patch
  1588. #
  1589. ${INSTP} -BXacgq -d ${PATCHDIR} bos.obj 3.2.0.0.U422467 2>&1 | ${TEE} ${LOG}.6
  1590. #
  1591. # Run the ptfdir clean utility.
  1592. #
  1593. /usr/sbin/ptfdir_clean -y -f -v 2>&1 | ${TEE} ${LOG}.2
  1594. #
  1595. # Install the PMP.    Version 1
  1596. #
  1597. /usr/lib/instl/sm_inst installp_cmd   \
  1598.         -T m -q -a -g -B              \
  1599.         -d ${PATCHDIR}                \
  1600.         -S '3250 AIX Maintenance Level U493250' \
  1601.         -c  -N  -X                    \
  1602.         2>&1 | ${TEE} ${LOG}.3
  1603. #
  1604. # Install the PMP.    Version 2
  1605. #
  1606. # /usr/sbin/update_all
  1607. #
  1608. # Install latest installp patch
  1609. #
  1610. /usr/bin/lppchk -v | ${TEE} ${LOG}.4
  1611. #
  1612. # Show level of installp patch
  1613. #
  1614. /usr/bin/lslpp -m bos.obj | ${TEE} ${LOG}.5
  1615. #
  1616. # Guess you should reboot now.
  1617. #
  1618. sync;sync
  1619. print - "\n\n\tDone......guess you should reboot now !!\n"
  1620. exit 0
  1621. =-=-=-=-=-=-=-= cut here =-=-=-=-=-=-=-=-=-=-=
  1622.  
  1623. 7) To run the update on your server
  1624.  
  1625.    ===>> Please read the Installation Instructions first <<==
  1626.  
  1627.    # cd /pub/pmp3250
  1628.    # ./runme.sh
  1629.  
  1630.                    ........WAIT...........
  1631.  
  1632.    # /etc/shutdown -Fr
  1633.  
  1634. 8) NFS export the PMP dir as READ-ONLY to all your clients.
  1635.  
  1636. 9) To update a client system
  1637.  
  1638.     a -  Mount the PMP filesystem from the server
  1639.     b -  cd <mounted_filesystem>
  1640.     c -  execute ./runme.sh
  1641.     d -  Unmount PMP filesystem
  1642.     e -  reboot
  1643.  
  1644. 10) To create a copy 1:1 of the tape you received use the script 'mktape.sh'
  1645.  
  1646.    # cd /pub/pmp3250
  1647.    # mktape.sh 0
  1648.  
  1649. =-=-=-=-=-=-=-= cut here =-=-=-=-=-=-=-=-=-=-=
  1650. #!/bin/ksh
  1651. # @(#) mktape.sh: creates a bootable tape from images on disk
  1652.  
  1653. # change name prefix here
  1654. NAME="f"
  1655.  
  1656. # usage: mktape drive_no
  1657. #        drive_no = tape drive number
  1658. # test arguments
  1659. if [ -z "${1}" ]
  1660. then
  1661.   echo "\nusage: mktape <drive_no>"
  1662.   echo "         <drive_no>: tape drive number (e.g. 0)\n"
  1663.   exit 1
  1664. fi
  1665. device=/dev/rmt${1}.1
  1666.  
  1667. tctl -f ${device} rewind
  1668. if [ $? -ne 0 ]
  1669. then
  1670.   exit 1
  1671. fi
  1672.  
  1673. # create tape
  1674. i=1
  1675. while test -r "${NAME}${i}"
  1676. do
  1677.     echo "copy ${i}"
  1678.     if [ $i -le 3 ]
  1679.     then
  1680.       dd if="${NAME}${i}" of=${device} conv=sync bs=1k
  1681.     else
  1682.       dd if="${NAME}${i}" of=${device} bs=200k
  1683.     fi
  1684.     let i=${i}+1
  1685. done
  1686. tctl -f ${device} rewind
  1687. exit 0
  1688.  
  1689.  
  1690. 1.128: AIX fix strategy
  1691. From: leedp@austin.ibm.com (Dennis Lee, PMP Release Manager)
  1692.  
  1693. First, a little history...
  1694.  
  1695. The maintenance strategy for AIX 3.1 was cumulative updates. Every few
  1696. months, we'd put all available fixes in one large package and ship it. 
  1697. There was no real strategy for providing a single fix. Although we'd
  1698. occasionally produce an emergency patch, there was no method for
  1699. tracking them; if you got a second one, it might overwrite the first. 
  1700. So, after a few of these patches, it's hard to track.
  1701.  
  1702. In AIX 3.2 we introduced a "selective fix" strategy to support
  1703. individual fixes. The package contained information about other fixes
  1704. that were required for that fix to work correctly. For example, a Korn
  1705. shell fix might require a change in libc.a, which might in turn require
  1706. a fix in the kernel. This strategy allowed us to keep track of which
  1707. fixes were installed to make sure we didn't overwrite one with another,
  1708. and make sure they all worked together. But the initial selective fix
  1709. design still had a few problems.
  1710.  
  1711.   o None of the fixes were cumulative.  If you got a fix for Korn shell,
  1712.     you may not receive all of the fixes for Korn shell.  This left the
  1713.     possibility of rediscovering other problems that were already fixed.
  1714.  
  1715.   o Since we chose to fix everything possible that was reported as a
  1716.     problem, instead of deferring them to the next release, the number
  1717.     of available fixes became quite large.
  1718.  
  1719.   o The number of additional fixes required by any given fix could also
  1720.     be quite large.  Since the installation program ran once for each
  1721.     fix, the size and complexity of the fix packages grew, and
  1722.     installation time lengthens greatly.
  1723.  
  1724. While developing the AIX 3.2.4 upgrade, we undertook a large effort to
  1725. resolve the selective fix concerns, and dramatically increase the
  1726. quality of AIX 3.2.  The base operating system and most of the optional
  1727. program products were split into subsystems.  A subsystem is a group of
  1728. logically related files.  The division was made such that changes to a
  1729. given subsystem were less likely to affect other subsystems.  In total
  1730. there are approximately 500 subsystems, but in practice, files have been
  1731. modified in only about half of them.  The advantages of the new
  1732. packaging strategy are:
  1733.  
  1734.   o Each subsystem package is cumulative, containing all of the fixes
  1735.     and enhancements to date for that subsystem.
  1736.  
  1737.   o The cumulative subsystem package is tested as an entity.
  1738.  
  1739.   o The number of fix packages is greatly reduced because the number of
  1740.     subsystems is far fewer than the number of fixes and enhancements.
  1741.  
  1742.   o The number of other fixes required by any given fix is also greatly
  1743.     reduced because a subsystem package has requisites only on other
  1744.     subsystem packages.
  1745.  
  1746.   o The reduced number of fix packages greatly reduced installation time.
  1747.  
  1748. Some customers also told us that they liked the maintenance level
  1749. strategy that we used in AIX 3.1.  They liked being able to install all
  1750. of the known fixes, and they liked knowing what "level" of AIX they had. 
  1751. To meet these requirements, we produced a Preventive Maintenance Package
  1752. (PMP).  The PMP is simply a collection of the latest cumulative
  1753. subsystem packages tied together in such a way that it can be installed
  1754. by selecting a single fix.  We also added flags to the lslpp command and
  1755. added a new command, oslevel, to show which PMP is installed.  Now we
  1756. had both! The good attributes of selective fix along with the good
  1757. attributes of maintenance levels. 
  1758.  
  1759. A few Q&As: 
  1760.  
  1761. Q. Why is the fix I just received 130 megabytes!@#? I already have the
  1762. AIX 3.2.4 update installed!
  1763. A. Your fix may be part of the AIX 3.2.5 update. AIX 3.2.5 is another
  1764. PMP that contains all of the fixes to date, as well as enhancements 
  1765. to support the PowerPC model 250, and the new high-end RS/2 models
  1766. 590 and 990, as well as support for new disk and tape drives, graphics
  1767. adapters and more.
  1768.  
  1769. Q. Why can't you just build my fix on 3.2.4? 
  1770. A. There really isn't such a thing as 3.2.1 or 3.2.2 or even 3.2.4. 
  1771. They're just collections of fixes and enhancements built on a 3.2 base. 
  1772. If the fix for your problem was built prior to 3.2.5, you can get the
  1773. older version. But if your fix was built for the first time in a 3.2.5
  1774. subsystem, that's the only version of the fix that exists.
  1775.  
  1776. See also 6.02.
  1777.  
  1778.  
  1779. 1.129: Are passwords limited to 8 char?
  1780.  
  1781. AIX passwords are only significant to 8 characters. You can set a
  1782. passwd to more than 8 characters but anything over eight are ignored.
  1783. No messages or warnings are given.
  1784.  
  1785. Be careful if you're running NIS. You probably want to limit passwords
  1786. to 8 char on all machines (6000 and others) to be compatible.
  1787.  
  1788. Someone mentioned that DCE supports kerberos which supports passwords
  1789. greater than 8 characters.
  1790.  
  1791.  
  1792. 1.130: How do I increase the number of ptys > 64?
  1793. From: mick@oahu.cern.ch (Mickey Coggins)
  1794.  
  1795. SMIT only allows 64. Try this:
  1796.  
  1797. odmget -q"attribute=num and uniquetype=pty/pty/pty" PdAt |
  1798. sed "s/0-64/0-512/" |
  1799. odmchange -q"attribute=num and uniquetype=pty/pty/pty" -o PdAt
  1800.  
  1801. chdev -l pty0 -anum=256 -P
  1802. reboot
  1803.  
  1804.  
  1805. 1.131: CERT advisories on sendmail and xterm
  1806.  
  1807. The following fixes are available for some CERT advisories on problems
  1808. with sendmail and xterm.
  1809.  
  1810. sendmail        - fix available as U426396
  1811. xterm for X11R4 - fix available as U422575
  1812. xterm for X11R5 - fix available as U425811
  1813.  
  1814. 1.132: How do I remove a non-existant physical volume?
  1815. Thanks to Johnny Shieh (shieh@austin.ibm.com)
  1816.  
  1817. To delete a phantom disk from the ODM use reducevg with the pvid
  1818. instead of the disk name.  You are running some command such as lsvg
  1819. or varyonvg and it is griping about a disk that is no longer findable
  1820. right?  In that warning message, it should give you a pvid.  Then
  1821. simply:
  1822.  
  1823. reducevg -f <pvid>
  1824.  
  1825.  
  1826. 1.133  How do I kill a process that ignores kill -QUIT -KILL -STOP
  1827.  
  1828. If there is i/o pending in a device driver, and the driver does not
  1829. catch the signal, you can't kill it - a reboot is the only way to
  1830. clear it.
  1831.  
  1832. Furthermore, if the process stays hung for more than a few minutes,
  1833. you can find out what device is wedged by doing this --
  1834.  
  1835. % echo trace -k $(expr <pid> / 256) | crash | tee stack
  1836.  
  1837. If you can't figure out what is wrong, print that trace out and call
  1838. 1-800-237-5511 and tell them that something is broken.  Tell them you
  1839. want to fax in the nice stack trace that you have as your testcase.
  1840.  
  1841.  
  1842. 1.134: How can I see "console" messages?
  1843. From: crow@tivoli.com (David L. Crow)
  1844.  
  1845. Use the swcons command to redirect the console to a file.  Or use
  1846. chcons to do it permanently.
  1847.  
  1848.  
  1849. 1.135: Where can I find TOP for AIX?
  1850.  
  1851. TOP functionality is included in an AIX package called Monitor
  1852. availible from aixpdslibs.seas.ucla.edu:/pub/monitor among other
  1853. places.
  1854.  
  1855.  
  1856. 1.136: How can I restrict root logins to specific terminals?
  1857. From: jfh@austin.ibm.com (John F. Haugh II)
  1858.  
  1859. Read the related FAX availible from the number in section 6.02.
  1860. See APAR IX45701 for fixes related to the rsh style commands.
  1861. [Editor's note: This section will be more specific by the next release.
  1862.  I'll send the updated version as requested.  -jw ]
  1863.  
  1864. 1.200: Some info about tape backups
  1865. From: Craig Anderson
  1866.  
  1867. The following supplements the information on rmt devices in
  1868. InfoExplorer. It is based on my own personal experience with IBM tape
  1869. drives running on AIX 3.1. No warranty is expressed or implied.
  1870.  
  1871. CONFIGURING THROUGH SMIT:
  1872.     BLOCK size (0=variable length)        (ALL)
  1873.     Sets the tape block size.  When reading, the block size must be
  1874.     set to the block size set when the tape was written.  When
  1875.     using some commands, tapes written with ANY block size can be
  1876.     read if the block size is set to 0 (variable length) (see
  1877.     "BLOCK SIZES" below).
  1878.  
  1879.     Use DEVICE BUFFERS during writes        (ALL)
  1880.     Set to yes, the device will buffer data internally on writes.
  1881.     This greatly improves performance, but under certain cases may
  1882.     be undesirable since the data is not written to tape before
  1883.     returning a good indication.
  1884.  
  1885.     Use EXTENDED file marks            (8mm only)
  1886.     Extended file marks take up much more space than short (or
  1887.     non-extended) file marks.  But extended file marks can be
  1888.     overwritten, allowing data not at the beginning of tape to be
  1889.     overwritten (see "FILE MARKS" below).
  1890.  
  1891.     RETENSION on tape change or reset        (1/4" only)
  1892.     If set to "no" then the tape will not be retentioned
  1893.     automatically when the tape is inserted.  Note that this will
  1894.     take effect only after the device is used.
  1895.  
  1896.  
  1897. FILE MARKS:
  1898.      Tape devices support multiple tape files.  Tape files are the
  1899.      result of a backup/cpio/tar/dd type command, where the device is
  1900.      opened, written to, and closed.  Because tapes allow large
  1901.      quantities of data to be written on a single tape, several backups
  1902.      (that is, tape files), may be combined on one physical tape.
  1903.      Between each tape file is a "tape file mark" or simply "file
  1904.      mark".  These file marks are used by the device driver to indicate
  1905.      where one tape file ends and another begins.
  1906.  
  1907.                               B       E
  1908.                    <-------   O       O   ------->
  1909.                               T       T
  1910.               __ ____________________________ _______________
  1911.      physical | \            |       |      \             |physical
  1912.      beginning|  \           | tape  |       \            | end
  1913.        of     |   \          | file  |        \           |  of
  1914.       tape    |    \         | mark  |         \          | tape
  1915.               |_____\________|_______|__________\_________|
  1916.  
  1917.      Note that there is a distinction between the beginning of tape
  1918.      (BOT) side of a file mark and the end of tape (EOT) side of a file
  1919.      mark.  If the head is on the BOT side of a file- mark, "tctl fsf
  1920.      1" command will move only to the EOT side of the same file mark.
  1921.  
  1922.      With the 1/4" tape drive, writing can only take place
  1923.      sequentially, or after blank tape has been detected.  You cannot
  1924.      write over data on the tape (except at BOT).  If you wish to add
  1925.      data to a tape which has been written and then rewound you should
  1926.      space forward file mark until an error occurs.  Only then can
  1927.      you start writing again.
  1928.  
  1929.      With an 8mm tape drive, writing can only take place before blank
  1930.      tape, an EXTENDED file mark, or at BOT.  Thus if several backups
  1931.      have been made on one tape and you wish to overwrite one of the
  1932.      backups, position the tape to the place you wish to start writing
  1933.      and issue the following commands:
  1934.     tctl bsf 1
  1935.     tctl eof 1
  1936.      The first command skips back to the BOT side of the same file
  1937.      mark.  The second command rewrites the file mark (writing is
  1938.      allowed before extended file marks).  The erase head will erase
  1939.      data ahead of the write head, so that after writing the file mark
  1940.      the head will be positioned before blank tape.  Only after this
  1941.      may you start writing over data in the middle of the tape.  (All
  1942.      data beyond where you are currently writing will be lost).  Note
  1943.      that you cannot write over short file marks.  In order for this to
  1944.      work, the tape must have been written with extended file marks
  1945.      (use smit to change this).
  1946.  
  1947.      With the 9-track drive writing can take place anywhere on the
  1948.      tape although overwriting single blocks of data is not supported.
  1949.  
  1950.      On the 8mm drive extended filemarks use 2.2 megabytes of tape and
  1951.      can take up to 8.5 seconds to write.  Short filemarks use 184K
  1952.      and take up to 1.5 seconds to write.
  1953.  
  1954. BLOCK SIZES:
  1955.      When data is written to tape it is written in blocks.  The blocks
  1956.      on a tape are separated by inter-record gaps.  It is important to
  1957.      understand the structure of the written tape in order to
  1958.      understand the problems which can occur with changing block
  1959.      sizes.
  1960.  
  1961.      In fixed block size mode all blocks on the tape are the same
  1962.      size.  They are the size of the block size set in the device
  1963.      configuration.  All read()s and write()s to the tape drive must be
  1964.      a multiple of the fixed block size.
  1965.  
  1966.      In fixed block mode a read() will return as many blocks as needed
  1967.      to satisfy the read() request.  If a file mark is encountered
  1968.      while reading the tape only the data up until the file mark will
  1969.      be returned.
  1970.  
  1971.      It is not possible for the tape drive to read a tape whose block
  1972.      size is not the same as the block size in the device
  1973.      configuration.  (Unless the device configuration is in variable
  1974.      size blocks.)
  1975.  
  1976.      In variable block size (0) mode, the blocks written on the tape
  1977.      are the size of the read() and write() requests to the device
  1978.      driver.  In this case, the actual block sizes on the tape can be
  1979.      changed using the options to the backup commands (tar -C, cpio -C,
  1980.      backup -C).
  1981.  
  1982.      In variable mode, read() requests greater than size of the block
  1983.      on the tape will return only the data from the next block on the
  1984.      tape.  It is this feature that allows tapes written in any block
  1985.      size (fixed or variable) to read with the dd command (the output
  1986.      from the dd command may be piped to restore, tar, or cpio for
  1987.      example.)  Note that backup, tar, and cpio cannot read all tapes
  1988.      by using a large block size because they assume there is an error
  1989.      if they get a short read().
  1990.         dd ibs=128k obs=16k if=/dev/rmt0 | ...
  1991.  
  1992.      The tape head is always positioned at an inter-record gap, file
  1993.      mark, or blank tape after reading or writing.
  1994.  
  1995.      With the 8mm tape drive, using a fixed block size which is not a
  1996.      multiple of 1K is inefficient.  The 8mm tape drive always writes
  1997.      internally in 1K blocks.  It simulates the effect of variable
  1998.      block sizes, but, for example, using a fixed block size of 512
  1999.      bytes (or using variable block size and write()ing 512 bytes at a
  2000.      time) wastes one half of the tape capacity and gives only one half
  2001.      the maximum transfer rate.
  2002.  
  2003.      To figure out a tape's actual block size try:
  2004.  
  2005.      1). Set the tape to variable block size.
  2006.      2). "dd if=<tape> of=/tmp/dummy bs=128k count=1"
  2007.      3). "ls -l /tmp/dummy"
  2008.      4). The number of bytes in "/tmp/dummy" is the physical block size.
  2009.  
  2010. EXCHANGING DATA WITH NON-UNIX AND OTHER VENDORS MACHINES:
  2011.      Many tape drives support both variable and fixed block sizes.
  2012.  
  2013.      Variable block mode writes block sizes the size of the write
  2014.      command issued (tar and backup specify this with the -b option). 
  2015.      In fixed mode, block sizes are fixed and all writes must be a
  2016.      multiple of the fixed block size.
  2017.  
  2018.      Unix often internally chops larger reads and writes up into
  2019.      manageable pieces (often 65535, 65534, or 65532 bytes) before
  2020.      doing the actual reads and writes.  This means reads and writes of
  2021.      64K bytes are often broken up into a 65535 byte record and a 1
  2022.      byte record (In fixed mode the write will fail).  Block sizes >=
  2023.      64K (-C128 and greater) should be avoided for this reason.  AIX
  2024.      does not break up read and write requests, but be aware of the
  2025.      situation on other machines.
  2026.  
  2027.      If the tape is written in an unknown block size then set the
  2028.      device configuration in smit to use variable size blocks, use the
  2029.      "dd" command with a large input block size, and pipe it to the
  2030.      restore command.  For example:
  2031.       chdev -l rmt0 -a block_size=0
  2032.       dd if=/dev/rmt0 ibs=128k obs=16k | tar -tvf-
  2033.  
  2034.  
  2035.